home *** CD-ROM | disk | FTP | other *** search
Java Source | 2000-09-28 | 2.4 KB | 94 lines | [TEXT/CWIE] |
- import java.awt.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
-
- public class Controller extends Window
- {
- //Declare constants
- //Insert "Controller Constants"
-
- //Declare data members
- //Insert "Controller data members"
-
- /**
- * Creates a Controller object with the specified parent Frame.
- * @param the parent frame to associate the controller with.
- */
- public Controller(Frame parent)
- {
- //Setup parent info for this window
- //Insert "Controller parent info"
-
- //INIT_CONTROLS
- //Setup and layout objects in the controller
- //Insert "Controller init controls"
-
- //REGISTER_LISTENERS
- //Register our action listener with our buttons
- //Insert "Controller register listeners"
-
- //Initialize state information.
- //Insert "Controller init state"
- }
-
- /**
- * Set the state of the Play/Pause button
- * @param if true, the button will be in the Play state;
- * If false it will be in the Pause state.
- * @see #isPlayState
- */
- public void setPlayState(boolean isPlay)
- {
- //Handle setup for the appropriate state
- //Insert "Controller setPlayState"
- }
-
- /**
- * Get the current state of the Play/Pause button
- * @return true if the button is in the Play state,
- * false if it is in the Pause state.
- * @see #setPlayState
- */
- public boolean isPlayState()
- {
- //Return the current state
- //Insert "Controller isPlayState"
- }
-
- //Routines for handling ActionListener management.
- //Insert "Controller Action Management"
-
- public void paint(Graphics g)
- {
- //Handle painting the border image, and let the super class paint the rest.
- //Insert "Controller paint"
- }
-
- public void update(Graphics g)
- {
- //Override update to simply call paint to reduce flicker.
- //Insert "Controller update"
- }
-
- /**
- * Gets the size the controller should be to look its best
- * @return the dimensions the controller renders its self the best.
- */
- public Dimension getPreferredSize()
- {
- //If the current image is not null, then return the size of the image.
- //If it is null, defer to the super class.
- //Insert "Controller getPreferredSize"
- }
-
- //Inner class so we can instantiate a simple lightweight container
- //for use in laying out the controller properly.
- class DumbContainer extends Container { }
-
- //Inner class to handle action events
- //Insert "Controller Action"
-
- //Routines to handle action events from the different buttons
- //Insert "Controller button actions"
- }
-